package com.iwhalecloud.citybrain.flow.platform.manager.infrastructure.repository;

import com.iwhalecloud.citybrain.flow.platform.manager.domain.repository.ResourcePersistRepository;
import com.iwhalecloud.citybrain.flow.platform.manager.application.common.command.ResourcePersistCmd;
import org.flowable.engine.ManagementService;
import org.flowable.engine.impl.persistence.entity.ResourceEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author lilh
 * @date 2019-01-30 17:01
 */
@Service
public class ResourcePersistRepositoryImpl implements ResourcePersistRepository {

    @Autowired
    private ManagementService managementService;

    @Override
    public void insert(ResourceEntity resourceEntity) {
        managementService.executeCommand(new ResourcePersistCmd(resourceEntity));
    }
}
